import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import {getImgUrl} from '@/apis/files'

Vue.prototype.$getImgUrl = getImgUrl

Vue.config.productionTip = false
Vue.directive('click-blur', {
  inserted(el) {
    el.addEventListener('click', () => {
      el.blur()
    })
  }
})

store.dispatch('category/initCategoryOn').then(() => {
  // 数据获取完成后再挂载应用（可选）
  new Vue({
    store,
    router,
    render: h => h(App)
  }).$mount('#app');
});